package com.itheima.reggie.config;

import com.itheima.reggie.filters.LoginCheckFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author: Jetwang
 * @date: 2022/4/10 19:49
 * @description: WebFilterConfig 过滤器注册
 * @version: 1.0
 */
@Configuration
public class WebFilterConfig {
    /**
     * 注册过滤器，并配置拦截路径
     * @return
     */
    @Bean
    public FilterRegistrationBean filterRegistrationBean() {
        FilterRegistrationBean bean = new FilterRegistrationBean();
        bean.setFilter(new LoginCheckFilter());
        bean.addUrlPatterns("/*");
        return bean;
    }
}
